![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
Class for infant hares (stationary, only milk inputs) More...
#include <hare_all.h>
Public Member Functions | |
virtual void | BeginStep (void) |
BeginStep for the Hare_Infant. More... | |
virtual void | Step (void) |
Step for the Hare_Infant. More... | |
virtual void | EndStep (void) |
EndStep for the Hare_Infant. More... | |
Hare_Infant (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Hare infant constructor. More... | |
void | ReInit (struct_Hare a_data) |
Infant object reinitiation. More... | |
void | Init () |
Object initiation. More... | |
virtual | ~Hare_Infant () |
Hare infant destructor. More... | |
virtual void | ON_Dead () |
This hare has been killed. More... | |
void | ON_BeingFed (double a_someMilk) |
Get energy from milk given. More... | |
void | SetWeight (double w) |
Set the weight. More... | |
void | SetMum (Hare_Female *a_af) |
Set the mother pointer. More... | |
![]() | |
THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Constructor. More... | |
void | THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM) |
Object Initiation. More... | |
virtual | ~THare () |
Destructor. More... | |
virtual TTypeOfHareState | st_Dispersal () |
Base implementation only - reimplemented. More... | |
double | GetWeight () |
double | GetTotalWeight () |
Provide the wet weight of the hare. More... | |
int | GetAge () |
void | ON_MumDead (Hare_Female *a_Mum) |
Inform Mum that we are dead. More... | |
void | SetMum (Hare_Female *) |
Set the mother pointer. Reimplemented in Hare_Infant. More... | |
Hare_Female * | GetMum () |
Get the mother pointer. More... | |
double | GetRMR () |
Get todays RMR. More... | |
virtual bool | WasPredated () |
Test for predation. More... | |
int | GetRefNum () |
Get the refnum for this hare. More... | |
void | loadVegPalatability (void) |
Loads static member m_vegPalatability with data. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Protected Member Functions | |
TTypeOfHareState | st_Developing () |
Developmental behaviour for the infant hare. More... | |
void | st_NextStage () |
'mature' to become a young More... | |
bool | OnFarmEvent (FarmToDo event) |
Do we require a response to a farm event. More... | |
![]() | |
bool | Run (int a_dist, int a_direction) |
Run a distance in a direction. More... | |
void | EnergyBalance (TTypeOfActivity a_activity, int dist) |
Adjust energy balance for an activity. More... | |
void | TimeBudget (TTypeOfActivity a_activity, int dist) |
Adjust time budger for an activity. More... | |
void | st_Dying () |
Tidy up before removing the object on death. More... | |
virtual void | Running (int a_max_dist) |
Run. More... | |
void | Walking (int a_dist, int a_direction) |
Walking. More... | |
double | Forage (int &time) |
Foraging. More... | |
double | ForageP (int &time) |
Foraging but also incorporating pesticide exposure. More... | |
virtual void | InternalPesticideHandlingAndResponse () |
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralEndocrineDisruptor (double) |
Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralOrganoPhosphate (double) |
Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
double | ForageSquare (int a_x, int a_y) |
Forage from an area. More... | |
double | ForageSquareP (int a_x, int a_y, double *a_pestexposure) |
Forage from an area and resturn pesticide exposure as well as food. More... | |
int | GetPegDistance () |
Get peg distance. More... | |
int | GetPegPull () |
Get attractive force of peg. More... | |
int | GetPegDirection () |
Get direction of peg. More... | |
void | MovePeg () |
Move the peg according to attraction forces. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
![]() | |
static double * | m_vegPalatability = NULL |
Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More... | |
![]() | |
TTypeOfHareState | m_CurrentHState |
Defines the current activity. More... | |
int | m_Age |
State variale - hare age. More... | |
Hare_Object | m_Type |
State variale - the type of hare. More... | |
double | m_weight |
State variale - hare weight g. More... | |
double | m_old_weight |
State variale - last hare weight. More... | |
Hare_Female * | m_MyMum |
Pointer to the hare's mum. More... | |
THare_Population_Manager * | m_OurPopulationManager |
Pointer to the hare population manager. More... | |
int | m_Lifespan |
Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More... | |
int | m_ActivityTime |
Minutes of potential activity time per day. More... | |
int | m_StarvationDays |
State variable - the number of consecutive days in negative energy balance. More... | |
double | m_fatReserve |
State variable - the energy reserve of the hare. More... | |
double | m_TodaysEnergy |
State variable - the amount of energy available today, can be in deficit. More... | |
double | m_EnergyMax |
State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More... | |
double | m_KJRunning |
KJ/m cost of running per kg hare. More... | |
double | m_KJWalking |
KJ/m cost of walking per kg hare. More... | |
double | m_KJForaging |
KJ/m cost of foraging per kg hare. More... | |
double | m_SpeedRunning |
m/min speed of running per kg hare More... | |
double | m_SpeedWalking |
m/min speed of walking per kg hare More... | |
double | m_foragingenergy |
Energy obtained from foraging/feeding. More... | |
int | m_peg_x |
peg x-coordinate More... | |
int | m_peg_y |
peg y-coordinate More... | |
int | m_RefNum |
Unique hare reference number, also functions as sex flag. More... | |
int | m_experiencedDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_lastYearsDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_ddindex |
State variable used in alternative density-dependent configurations. More... | |
int | m_expDensity [365] |
State variable used in alternative density-dependent configurations. More... | |
int | m_DensitySum |
State variable used in alternative density-dependent configurations. More... | |
bool | m_IamSick |
flag for sickness - used in conjunction with disease configurations More... | |
double | m_pesticide_burden |
State variable used to hold the current body-burden of pesticide. More... | |
double | m_pesticidedegradationrate |
State variable used to hold the daily degredation rate of the pesticide in the body. More... | |
bool | m_pesticideInfluenced1 |
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
Class for infant hares (stationary, only milk inputs)
Hare_Infant::Hare_Infant | ( | int | p_x, |
int | p_y, | ||
Landscape * | p_L, | ||
THare_Population_Manager * | p_PPM | ||
) |
Hare infant constructor.
References Init().
|
virtual |
BeginStep for the Hare_Infant.
Tests for mortality. Both standard mortality tests and optional density dependent mortality. NB this differs from all other ALMaSS models in that the farm events do not have any direct impact on any hare stage except this one. I assume that all other stages can run away - seems not to cause a problem with fitting to Illumø
Reimplemented from THare.
Reimplemented in Hare_Young.
References TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetInterference(), THare_Population_Manager::GetKJperM(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, TALMaSSObject::m_CurrentStateNo, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, THare::m_old_weight, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, THare_Population_Manager::m_YoungMortRate, and ON_Dead().
|
virtual |
EndStep for the Hare_Infant.
Reimplemented from THare.
Reimplemented in Hare_Young.
References THare::m_CurrentHState, THare::MovePeg(), ON_Dead(), st_Developing(), tohs_Developing, and tohs_Dying.
void Hare_Infant::Init | ( | void | ) |
Object initiation.
References hob_Infant, THare::m_Age, THare::m_old_weight, THare::m_Type, and THare::m_weight.
Referenced by Hare_Infant(), Hare_Young::Hare_Young(), ReInit(), and Hare_Young::ReInit().
void Hare_Infant::ON_BeingFed | ( | double | a_someMilk | ) |
Get energy from milk given.
The conversion efficiency is pre-calcualted in GetgperKJ so this function is quite simply a conversion from KJ to g
NOTE There are no limits here - the limit to growth has to be by the limited amount of milk supplied - the ultimate limit to this has got to be defined somewhere else (e.g. female forage).
References THare::m_TodaysEnergy.
Referenced by Hare_Female::DoLactation().
|
virtual |
This hare has been killed.
Do the housekeeping necessary before dying
Reimplemented from THare.
Reimplemented in Hare_Young.
References THare::st_Dying().
Referenced by BeginStep(), EndStep(), and OnFarmEvent().
|
protectedvirtual |
Do we require a response to a farm event.
Checks to see if any nasty farm event has caused the death of the infant.
Currently there is only one response to those events where death is possible. However, this may not always be the case so the code is structured as for the other ALMaSS animals (i.e. it could be a bit easier to overview if it were written differently).
Reimplemented from THare.
Reimplemented in Hare_Young.
References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, bed_forming, biocide, bulb_harvest, burn_straw_stubble, cattle_out, cattle_out_low, cfg_hare_i_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_calcium, fa_greenmanure, fa_manganesesulphate, fa_manure, fa_npk, fa_npks, fa_pk, fa_rsm, fa_sludge, fa_slurry, flower_cutting, fp_ammoniumsulphate, fp_calcium, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_rsm, fp_sludge, fp_slurry, fungicide_treat, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, molluscicide, mow, ON_Dead(), pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, random(), row_cultivation, shallow_harrow, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, and winter_plough.
void Hare_Infant::ReInit | ( | struct_Hare | a_data | ) |
Infant object reinitiation.
References struct_Hare::HM, Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::THareInit(), struct_Hare::x, and struct_Hare::y.
Referenced by THare_Population_Manager::CreateObjects().
|
inline |
Set the mother pointer.
References THare::m_MyMum.
Referenced by THare_Population_Manager::CreateObjects().
|
inline |
Set the weight.
This is only used when a hare is born, so no need to have it in the base class
References THare::m_weight.
Referenced by THare_Population_Manager::CreateObjects().
|
protected |
Developmental behaviour for the infant hare.
This code must be called by the EndStep.
To do this we need to add growth and energy requirements. The idea is to grow immediately on milk supply - handled via ON_someMilk()but if there are any other adjustments to be made they ought to be done here, e.g. if energy is needed for movement or thermoregululation. The easiest way to manage things is to use weight as a measure of energy, and convert freely between the two. This means that conversion efficiencies need to be applied to the energy inputs (done in on_BeingFed)
First remove our BMR
Make sure m_TodaysEnergy is zero before we run the risk of getting milk from Mum again during Step tomorrow.
If all is well then mature to become a Hare_Young
References cfg_infant_starvation_threshold, THare_Population_Manager::GetGrowthEfficiency(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare_Population_Manager::GetRMR(), THare::GetTotalWeight(), THare::m_Age, THare::m_old_weight, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, tohs_Developing, tohs_Dying, tohs_NextStage, and CfgInt::value().
Referenced by EndStep().
|
protected |
'mature' to become a young
This creats a Hare_Young object via a call to create objects then sets the flag for destruction of this object.
References struct_Hare::age, THare_Population_Manager::CreateObjects(), struct_Hare::HM, struct_Hare::L, THare::m_Age, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_weight, struct_Hare::Mum, tohs_DestroyObject, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by Step().
|
virtual |
Step for the Hare_Infant.
The step code is the main activity sub-stepfor each time-step. A dead animal will have m_CurrentStateNo set to -1 It is essential that before an animal is killed that it has sent all the necessary messages to others (in this case to its mother).
m_CurrentHState holds the current behavioural state
Reimplemented from THare.
Reimplemented in Hare_Young.
References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_NextStage(), tohs_Developing, tohs_Dying, tohs_InitialState, tohs_NextStage, tohs_Running, and Landscape::Warn().